package com.cooper.domain;

import java.io.Serializable;
import java.sql.Timestamp;

import com.alibaba.fastjson.JSON;
import com.cooper.constants.ResourceConstants;

/**
 * POJO的基础类
* @Description: 
* @version: v1.0.0
* @author: tianlg
* @date: Oct 18, 2014 9:38:13 PM
*
* Modification History:
* Date         Author          Version            Description
*---------------------------------------------------------*
* Oct 18, 2014     tianlg          v1.0.0
 */
public class Entity implements Serializable {
	
	private static final long serialVersionUID = -8971647027027227417L;
	
	public static final String DEFAULT_USER_SYS = "sys";
	public static final Timestamp NOW = new Timestamp(System.currentTimeMillis());
	
	public static final String ID = "id";
	private Long id;
	
	public static final String CREATOR = "creator";
	private String creator = DEFAULT_USER_SYS;
	
	public static final String MODIFIER = "modifier";
	private String modifier = DEFAULT_USER_SYS;
	
	public static final String GMT_CREATE = "gmtCreate";
	private Timestamp gmtCreate = NOW;
	
	public static final String GMT_MODIFIED = "gmtModified";
	private Timestamp gmtModified = NOW;
	
	public static final String DELETED = "deleted";
	private String deleted = ResourceConstants.Deleted.NO;
	
	/** 备注, 可选项 */
	public static final String COMMENTS = "comments";
	private String comments;
	
	@Override
	public String toString(){
		return JSON.toJSONString(this);
	}
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
	}
	public String getModifier() {
		return modifier;
	}
	public void setModifier(String modifier) {
		this.modifier = modifier;
	}
	public Timestamp getGmtCreate() {
		return gmtCreate;
	}
	public void setGmtCreate(Timestamp gmtCreate) {
		this.gmtCreate = gmtCreate;
	}
	public Timestamp getGmtModified() {
		return gmtModified;
	}
	public void setGmtModified(Timestamp gmtModified) {
		this.gmtModified = gmtModified;
	}
	public String getDeleted() {
		return deleted;
	}
	public void setDeleted(String deleted) {
		this.deleted = deleted;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	
}
